<template>
  <div shadow="never">
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <el-button  size="small " class="addBtn" type="primary" @click="handleAdd">新增</el-button>
    </div>
    <el-table ref="multipleTable"
              border
              highlight-current-row
              size="small"
              style="width: 100%"
              v-loading="loading"
              :data="dataSource"
              :header-cell-style="{background:'#eef1f6',color:'#606266'}"
              :default-sort = "{prop: 'inboundDate', order: 'descending'}">
      <el-table-column type="index" width="50"></el-table-column>
      <el-table-column prop="itemText" label="显示值"></el-table-column>
      <el-table-column prop="itemValue" label="实际值" sortable></el-table-column>
      <el-table-column prop="description"  label="备注" sortable></el-table-column>
      <el-table-column  width="150" fixed="right" label="操作">
        <template slot-scope="scope">
            <el-button @click="handleEdit(scope.row)" type="text">编辑</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页 -->
    <pagination
      :total="ipagination.total"
      :page.sync="ipagination.current"
      :limit.sync="ipagination.pageSize"
      @pagination="loadData"
    ></pagination>
    <dict-item-modal  ref="modalForm" @ok="modalFormOk"></dict-item-modal>
  </div>

</template>
<script>

  import { SingleTableMixins } from '@/mixins/SingleTableMixins'
  import Pagination from '@/components/Pagination'
  import { putAction,postAction} from '@/api/manage'
  import  DictItemModal from './DictItemModal'


  export default {
    name: 'SysDict',
    mixins: [ SingleTableMixins ],
    components: {DictItemModal, Pagination},
    data() {
      return {
        disableMixinCreated:true,
        url:{
          list: "/sys/dictItem/list",
          delete: "/sys/dictItem/delete"
        },
        ipagination:{
          pageSize: 10,
          current:1,
          total: 0
        },
        /* 排序参数 */
        isorter:{
          column: 'sortOrder',
          order: 'asc',
        },
      }
    },
    methods: {
      getDataByMain(id,row) {
        this.queryParam.dictId = id;
        this.loadData(1);
      },
      handleAdd: function () {
        this.$refs.modalForm.add(this.queryParam.dictId);
        this.$refs.modalForm.title = "新增明细";
      },
    }
  }
</script>

<style scoped>

</style>
